package com.smartmedical.es.controler;

import com.smartmedical.es.util.HighLevelRestUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TController {
    @Autowired
    private HighLevelRestUtil highLevelRestUtil;

    @GetMapping("get")
    public boolean get() {
        boolean b1 = highLevelRestUtil.checkIndex("book3");
        System.out.println("未创建索引时查找"+b1);
        boolean b = highLevelRestUtil.createIndex("book3",null);
        System.out.println("是否创建成功"+b);
        boolean b2 = highLevelRestUtil.checkIndex("book3");
        System.out.println("创建索引后查找"+b2);
        return b2;
    }
}
